<link href="<?php echo base_url(); ?>assets/js/jquery.ui.all.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/jquery.ui.core.js"></script>
<link href="<?php echo base_url(); ?>assets/js/jquery.ui.core.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/jquery.ui.datepicker.js"></script>
<link href="<?php echo base_url(); ?>assets/js/jquery.ui.datepicker.css" rel="stylesheet" type="text/css" />
<script>
	$(function() {
		$( "#datepicker1" ).datepicker({
dateFormat: 'mm/dd/yy'
		});
		$( "#datepicker2" ).datepicker({
dateFormat: 'mm/dd/yy'
		});
	});
	</script>
	<script language="javascript" type="text/javascript" src="<?php echo base_url(); ?>assets/js/tiny_mce/tiny_mce.js"></script>
	<script language="javascript" type="text/javascript">
		tinyMCE.init({
			mode : "exact",
			elements : "cmaincontent,cmaincontent_tr",

			theme : "advanced",
			plugins : "advimage,advlink,media,contextmenu,paste",
			theme_advanced_buttons1_add_before : "newdocument,separator",
			theme_advanced_buttons1_add : "fontselect,fontsizeselect",
			theme_advanced_buttons2_add : "separator,forecolor,backcolor,liststyle",
			theme_advanced_buttons2_add_before: "pastetext,pasteword,cut,copy,separator,",
			theme_advanced_buttons3_add_before : "",
			<!--theme_advanced_buttons3_add : "media",-->
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			extended_valid_elements : "hr[class|width|size|noshade]",
			file_browser_callback : "ajaxfilemanager",
			paste_use_dialog : false,
			theme_advanced_resizing : true,
			theme_advanced_resize_horizontal : true,
			apply_source_formatting : true,
			force_br_newlines : true,
			force_p_newlines : false,	
			relative_urls : true,
			//  VERRRRYYYYY   IMPORTANT TO GET CONTENT IN SERVER SIDE			
			setup : function(ed) { 
      		ed.onChange.add(function(ed, l) { 
         	var hidden = document.getElementById('cmaincontent');
			var hidden2 = document.getElementById('cmaincontent_tr');
         	hidden.value = l.content; }); }

		});

		function ajaxfilemanager(field_name, url, type, win) {
			var ajaxfilemanagerurl = "../../../../../assets/js/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php";
			switch (type) {
				case "image":
					break;
				case "media":
					break;
				case "flash": 
					break;
				case "file":
					break;
				default:
					return false;
			}
            tinyMCE.activeEditor.windowManager.open({
                url: "../../../../../assets/js/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php",
                width: 750,
                height: 400,
                inline : "yes",
                close_previous : "no"
            },{
                window : win,
                input : field_name
            });
		}
	</script>

<div class="RightColumn">
<form action="<?php echo base_url().index_page(); ?>/adminpage/cpanel/events_manipulate/" method="post" enctype="multipart/form-data" name="adminForm" id="adminForm" autocomplete="off">
            <div class="P10">
                <h2 class="Title01 P10 BorderBot01">Events Manager - Edit item</h2>
                 <div id="language" style="cursor:pointer"><img id="english" src="<?php echo base_url(); ?>assets/admin/img/uk.png" title="English"/>&nbsp;<img id="turkey" src="<?php echo base_url(); ?>assets/admin/img/Turkey.png" title="Turkish"/>
 </div>
                
                <div class="P10">
                <div id="en">
                    <h4 class="Title02 P10Bot">1. Enter the Events Name:</h4>
                    <p class="FS12 P10Bot">
                        Event name is the title that will display inside the Calander application which is located on the "Activities Page". Event Name will also function as a link to which will display the event details and galleries. Try to keep short. 
                    </p>
                    <div class="BlueBackground M20Bot">
                     <input  type="text"  name="name1" id="name1" class="AllBoxText" value="<?php echo isset($banners[0]['name'])?$banners[0]['name']:""; ?>" style="width:40%;" />
                        
                    </div>
                    <h4 class="Title02 P10Bot">2. Enter the Article Title:</h4>
                    <p class="FS12 P10Bot">
                        Event name is the title that will display inside the Calander application which is located on the "Activities Page". Event Name will also function as a link to which will display the event details and galleries.
                    </p>
                    <div class="BlueBackground M20Bot"> 
                        <input  type="text"  name="title1" id="title1" class="AllBoxText" value="<?php echo isset($banners[0]['title'])?$banners[0]['title']:""; ?>" style="width:40%;" />
                    </div>
                     <h4 class="Title02 P10Bot">3. Enter the Events Address <span>(full address for Google Map)</span>:</h4>
                    <p class="FS12 P10Bot">
                        Event Address simply gives website site admin the ability to add the address where the event will take place. Site viewers can see the Event Address when they click on Event Details.
                    </p>
                    <div class="BlueBackground M20Bot"> 
                        <input  type="text"  name="address1" id="address1" class="AllBoxText" value="<?php echo isset($banners[0]['address'])?$banners[0]['address']:""; ?>" style="width:40%;" />
                    </div>
                    <h4 class="Title02 P10Bot">4. Enter the Description:</h4>
                    <p class="FS12 P10Bot">
                        Event Article description area gives you the ability to wrote an article about each event. You can add an article about an upcoming event or you can return to this page (EDIT) and update this article after event is over.
                    </p>
                    <div class="BlueBackground M20Bot"> 
                        <textarea id="cmaincontent" name="maincontent1" style="width: 80%; height: 500px"><?php echo isset($banners[0]['content'])?$banners[0]['content']:""; ?></textarea>
                    </div>
                    </div>
                    
                    <div id="tr">
                    <h4 class="Title02 P10Bot">1. Enter the Events Name:</h4>
                    <p class="FS12 P10Bot">
                        Event name is the title that will display inside the Calander application which is located on the "Activities Page". Event Name will also function as a link to which will display the event details and galleries. Try to keep short. 
                    </p>
                    <div class="BlueBackground M20Bot">
                     <input  type="text"  name="name2" id="name2" class="AllBoxText" value="<?php echo isset($banners[1]['name'])?$banners[1]['name']:""; ?>" style="width:40%;" />
                        
                    </div>
                    <h4 class="Title02 P10Bot">2. Enter the Article Title:</h4>
                    <p class="FS12 P10Bot">
                        Event name is the title that will display inside the Calander application which is located on the "Activities Page". Event Name will also function as a link to which will display the event details and galleries.
                    </p>
                    <div class="BlueBackground M20Bot"> 
                        <input  type="text"  name="title2" id="title2" class="AllBoxText" value="<?php echo isset($banners[1]['title'])?$banners[1]['title']:""; ?>" style="width:40%;" />
                    </div>
                     <h4 class="Title02 P10Bot">3. Enter the Events Address <span>(full address for Google Map)</span>:</h4>
                    <p class="FS12 P10Bot">
                        Event Address simply gives website site admin the ability to add the address where the event will take place. Site viewers can see the Event Address when they click on Event Details.
                    </p>
                    <div class="BlueBackground M20Bot"> 
                        <input  type="text"  name="address2" id="address2" class="AllBoxText" value="<?php echo isset($banners[1]['address'])?$banners[1]['address']:""; ?>" style="width:40%;" />
                    </div>
                    <h4 class="Title02 P10Bot">4. Enter the Description:</h4>
                    <p class="FS12 P10Bot">
                        Event Article description area gives you the ability to wrote an article about each event. You can add an article about an upcoming event or you can return to this page (EDIT) and update this article after event is over.
                    </p>
                    <div class="BlueBackground M20Bot"> 
                        <textarea id="cmaincontent_tr" name="maincontent2" style="width: 80%; height: 500px"><?php echo isset($banners[1]['content'])?$banners[1]['content']:""; ?></textarea>
                    </div>
                    
					</div>
                    <h4 class="Title02 P10Bot">5. Choose Event Dates:</h4>
                    <p class="FS12 P10Bot">
                        Event Daes simply gives website site admin the ability to add the address where the event will take place. Site viewers can see the Event Dates on the website calendar. Event Date will also be displayed on Event Details page.
                    </p>
                    <div class="BlueBackground M20Bot">
                        <ul class="DateList">
                            <li>
                                <div class="Background04">
                                    <input  type="text" onfocus="if(this.value == 'choose starting date:'){ this.value = '';}" onblur="if(this.value == ''){ this.value = 'choose starting date:';}" name="txtStartDate"  id="datepicker1"  class="AllBoxText01" value="<?php echo isset($banners[1]['begin_date'])?my_int_date($banners[1]['begin_date']):"choose starting date:"; ?>" style="width:82%;" />
                                    <a href="#" title="Select Date"><img src="<?php echo base_url(); ?>assets/admin/img/icon-date.gif" alt="Icon date" /></a>
                                </div>
                            </li>
                            <li>
                                <div class="Background04">
                                    <input  type="text" onfocus="if(this.value == 'choose ending date:'){ this.value = '';}" onblur="if(this.value == ''){ this.value = 'choose ending date:';}" name="txtEndingDate" id="datepicker2"  class="AllBoxText01" value="<?php echo isset($banners[1]['begin_date'])?my_int_date($banners[1]['end_date']):"choose ending date:"; ?>" style="width:82%;" />
                                    <a href="#" title="Select Date"><img src="<?php echo base_url(); ?>assets/admin/img/icon-date.gif" alt="Icon date" /></a>
                                </div>
                            </li>
                        </ul>
                    </div>
					<h4 class="Title02 P10Bot">6. Event Gallery Images:</h4>
                    <p class="FS12 P10Bot">
                        Event Gallery Images gives site admin the ability to upload images for each event. Images you have for a particular event can be displayed on Event Details page. Simply click on browse and upload you photos.<strong>Allow file type</strong>: png, jpg, gif. <strong>Max size</strong>: 5 MB</p>
                    </p>
					<?php 
					for($i=0;$i<5;$i++)
					{
					?>
                    <div class="BlueBackground M1Bot">
                        <div class="Container">
					        <div class="Picture">
						        <?php echo $i+1; ?>. Upload Downloadable Item:<p style="padding-top:10px">
                            <?php if (isset($gallery[$i]['image']))
							{
							?>
						        <img src="<?php echo base_url(); ?>upload_file/article/<?php echo $gallery[$i]['image']; ?>" width="279px" />
                            <?php 
							}
							else
							{
								if($id!='')
								{
							?>
                            <img src="<?php echo base_url(); ?>assets/img/noimage.png" width="280px" />
                            <?php 
								}
							}
							?>	</p>
					        </div>
					        <div class="Description1">
                               
                                <ul class="UpLoadImage">
                                    <li><input  type="file" name="image<?php echo $i; ?>" class="AllBoxText" style="width:300px;" /></li>
                                </ul>
					        </div>
				        </div>
                    </div>
					<?php 
					}
					?>
                    <p class="W95" style="padding-top:10px">
                    <input type="hidden" name="currentid" value="<?php echo $id; ?>" />
                        <div style="width:100px;float:left"><a style="cursor:pointer" onclick="javascript: document.forms[0].submit();"  class="Button01" title="Save">Save</a></div><div style="width:20px;float:left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div style="width:100px;float:left"><a href="<?php echo base_url().index_page(); ?>/adminpage/cpanel/eventsmanager" class="Button01" title="Cancel">Cancel</a></div>
                    </p>
					<p class="W95">&nbsp;</p>
                </div>
            </div>
            </form>
</div>
<script>
jQuery(document).ready(function(){
	jQuery("#EventsManager").addClass('current');
});
</script>